// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import vueResource from 'vue-resource'
import mintui from 'mint-ui'
import ElementUI from 'element-ui';
import moment from "moment"
import common from "./data/common"

Vue.config.productionTip = false
Vue.use(vueResource);
Vue.use(mintui)
Vue.use(ElementUI)

Vue.filter("datefmt", function (input, fmt) {
  return moment(input).format(fmt);
});

// router interceptor
// router.beforeEach((to, from, next) => {
//   console.log("router before each to=" + to.path + ",from=" + from.path)
//   if (to.path == "/login") {
//     next();
//   }
//     if (common.isLogin) {
//       next();
//     } else {
//       next("/login");
//     }
// });
// cs
import 'mint-ui/lib/style.css'
import 'element-ui/lib/theme-chalk/index.css';
import '../static/css/site.css'
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
